<!-- 班时表格 -->

<template>
  <WebTable path="time" class="ScheduleTime-MyTable">
    <RowIndex />

    <RowTitle label="班时名称" bind="timeName" />

    <RowSlot label="班时">
      <template #default="{ row }">{{ row.timeBegin }} - {{ row.timeEnd }}</template>
    </RowSlot>

    <RowSlot label="休息时间">
      <template #default="{ row }">{{ row.relaxBegin }} - {{ row.relaxEnd }}</template>
    </RowSlot>

    <RowSlot label="预览图" :minWidth="300" noTip>
      <template #default="{ row }">
        <QueuePreview :obj="row" />
        <QueuePreview :extra="row" />
      </template>
    </RowSlot>

    <RowOperate :btns="['show']" show="选择" :onShow="toChoose" :width="80" />
  </WebTable>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'TimeTable',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb('time', 'time_')],

  /**
   * 组件导入 (Abc.vue + Abc/index.vue)
   */
  ...CORE.components(require.context('@admin/views/Maintain/Schedule/components', true, /vue$/)),

  /**
   * 本地方法 (轻量重要在前)
   */
  methods: {
    /**
     * 点击复选
     */
    toChoose(time) {
      // 选中事件
      this.$emit('choose', time)

      // 关闭弹窗
      this.time_closeModal()
    },
  },
}
</script>

<style lang="scss">
@import '@admin/views/Maintain/Schedule/ScheduleTime/MyTable/index.scss';
</style>
